-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
Rakefile
Outdated
@@ -96,7 +96,7 @@ task :windows do | |||
set_env = "GOOS=windows GOARCH=#{arch}" | |||
end | |||
go_build("github.com/DataDog/datadog-trace-agent/agent", { | |||
:cmd => set_env + " go build -a -o trace-agent-windows-#{arch}.exe", | |||
:cmd => set_env + "&& go build -a -o trace-agent-windows-#{arch}.exe", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GOOS=windows GOARCH=#{arch} && go build -a -o trace-agent-windows-#{arch}.exe
could be a full command? not sure it works when os
doesn't evaluate to windows
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially the command worked only on UNIX, I added the windows case a couple of months ago. It does work when the os doesn't evaluate to windows because the go compiler is able to cross compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I mean is if the command above is executed that way, because it doesn't work if it's the case:
$ GOOS=windows env | grep GOOS
# -> GOOS=windows
$ GOOS=windows && env | grep GOOS
# -> returns nothing because the ENV variable is not set since `env` is executed as a second command
So my question is if a code path can generate the command I wrote in the previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what you mean :S
On Windows the command that gets executed is:
set "GOOS=windows" && set "GOARCH=386"&& go build -a -o trace-agent-windows-386.exe ...
And on other platforms it is:
GOOS=windows GOARCH=386&& go build -a -o trace-agent-windows-386.exe ...
Both commands are working and produce windows binaries, the difference is due to the way environment variables are set in Windows and Unix.
Can you elaborate on what may not be working?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to me!
The command to build the windows target was broken because of mistake when concatenating the two parts of the command.